package com.aplana.ccsd.model;

import info.magnolia.module.templatingkit.dam.DAMException;

/**
 * 
 * Меню с вендорами
 * 
 */
public class VendorMenuItem {

	private final Vendor vendor;
	private final MenuItem menu;
	private final String htmlStyle;

	public VendorMenuItem(Vendor vendor, MenuItem menu, String style) {
		this.vendor = vendor;
		this.menu = menu;
		this.htmlStyle = style;
	}

	public Vendor getVendor() {
		return vendor;
	}

	public MenuItem getMenu() {
		return menu;
	}

	public String getHtmlStyle() {
		return htmlStyle;
	}

	public boolean isHasContent() throws DAMException {
		return (!org.apache.commons.lang.StringUtils.isBlank(vendor.getText()))
				|| (vendor.getMenuImage() != null ? (!org.apache.commons.lang.StringUtils
						.isBlank(vendor.getMenuImage().getLink())) : false);
	}

	@Override
	public String toString() {
		return "VendorMenuItem [vendor=" + vendor + ", menu=" + menu + "]";
	}

}
